bitkeeper revision 1.1713.1.12 (42b0da31QIvTtfE2iHo4yER4A1GFIw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 16 Jun 2005 01:47:29 +0000 (01:47 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 16 Jun 2005 01:47:29 +0000 (01:47 +0000)
serial.c:
  Fix serial_getc locking.

xen/drivers/char/serial.c

index bec789e084fc21bd78c4282fc792aeaa8805d842..ad5ad5cde0cdf75c3da9a9de87b580729abba6a4 100644 (file)
@@ -176,11 +176,15 @@ char serial_getc(int handle)
             if ( port->rxbufp != port->rxbufc )
             {
                 c = port->rxbuf[MASK_SERIAL_RXBUF_IDX(port->rxbufc++)];
+                spin_unlock_irqrestore(&port->lock, flags);
                 break;
             }
             
             if ( port->driver->getc(port, &c) )
+            {
+                spin_unlock_irqrestore(&port->lock, flags);
                 break;
+            }
 
             spin_unlock_irqrestore(&port->lock, flags);